Skip to content

Scroll twice as far, with a setting for how far - #26

Open
srozen wants to merge 1 commit into
mainfrom
faster-scrolling
Open

srozen wants to merge 1 commit into
mainfrom
faster-scrolling

Conversation

@srozen

@srozen srozen commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Closes #24. The trackpad and the mouse wheel now scroll twice as far as before, and Settings › Shell › Scrolling sets how far: from 1×, SwiftTerm's own rate, to 5×, in half steps.

Why it was slow

SwiftTerm moves the scrollback with the fingers, pixel for pixel (trackpad deltas divided by the row height, the remainder kept for the next event), and a notch of the mouse wheel moves one line. That feels natural over a page but takes many swipes through a long output. SwiftTerm already scales the wheel by scrollSensitivity; nothing set it.

Summary

Preferences.scrollSpeed        1…5, 2 by default; a stored value out of range falls back to 2
  → Pane.applyPreferences      terminal.scrollSensitivity = scrollSpeed (every pane, as soon as it changes)
  → SwiftTerm scrollWheel      delta × sensitivity, then: scrollback, mouse reports, or arrow keys
  • It applies in full-screen programs too (vim, less), since SwiftTerm scales the delta before deciding where it goes. SwiftTerm still caps how many reports or keys one event sends.
  • Settings › Shell gets a Scrolling section with a slider, next to Selection. No screenshot shows that page, so none were retaken.
  • Docs: settings.md and command-line.md.

Tests

  • PaneTests.aWheelNotchScrollsAsFarAsTheSettingSays sends real line-unit wheel events to a pane in a window: a notch moves 2 lines by default, 4 at 4×.
  • PreferencesTests cover the default, keeping a change, and repairing a value out of range.
  • All three CI gates pass locally: build with tests, the full suite (217 + 350), and the universal release app.

🤖 Generated with Claude Code

Scrolling through a long output took many swipes. SwiftTerm moves the
scrollback with the fingers, pixel for pixel, and a notch of the mouse
wheel moves one line. Codec now multiplies that, through SwiftTerm's
scrollSensitivity, by a new setting: Settings › Shell › Scrolling, from
1× (SwiftTerm's own rate) to 5× in half steps, 2× by default. It applies
to every pane as soon as it changes, and in full-screen programs such as
vim and less too, since SwiftTerm scales the wheel before deciding where
it goes.

A test sends real wheel events to a pane and checks that a notch moves
two lines by default and four at 4×; the preferences tests cover the
default, keeping a change and repairing a value out of range.

Closes #24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scroll through output is slow

1 participant